<div style="clear:both;"> </div>

<div style="margin: 0 auto;overflow: auto;width: 96%;" class="re_page">
	<div class="re_tot">
		<div class="re_tot1">
			<div class="re_left">
				<h2>Reports</h2>
			</div>
			<div class="re_tit">
				<span>Merchant Name: <?php echo $merchant_details['name'];?></span>
				<span>MarketPlace ID: <?php echo $merchant_details['marketplace_id'];?></span>
			</div>
		</div>
		<div class="re_search">
			<form id="searchbox" method="POST">
				<?php echo form_dropdown('report_type', array('' => 'Select Report')+$reports, $report_type, 'id="search"');?>

				<?php echo form_dropdown('status', array('' => 'Select Status')+$status_list, $status, 'id="search"');	?>
				<input id="submit" type="submit" value="Search">
			</form>
		</div>
		<?php if( strcmp('',$next_token) !== 0 ):?>
		<form method="POST">
			<input type="hidden" name="next_token" value="<?php echo $next_token;?>" />
			<button class="re_next1">Next</button>
		</form>
		<?php endif; ?>

	</div>

	<div style="margin: 0 auto;overflow: auto;width: 96%;" class="re_table">
		<table cellspacing="0" cellpadding="0" width="100%">



			<tr>
				<th>Report Request ID</th>
				<th>Report Type</th>
				<th>Start Date</th>
				<th>End Date</th>
				<th>Status</th>
				<th>Submitted Date</th>
			</tr>
			<?php 
//echo "<pre>";print_r($this->data);exit;
			$i=1;
			foreach($records as $row){ 
				echo "<tr>";

				echo "<td>";
				echo $row['ReportRequestId'];
				echo "</td>";
				echo "<td>";
				echo get_report_name($row['ReportType']);
				echo "</td>";
				echo "<td>";
				echo $row['StartDate'];
				echo "</td>";
				echo "<td>";
				echo $row['EndDate'];
				echo "</td>";
				echo "<td>";
				echo isset($status_list[$row['ReportProcessingStatus']])?$status_list[$row['ReportProcessingStatus']]:$row['ReportProcessingStatus'];
				echo "</td>";
				echo "<td>";
				echo $row['SubmittedDate'];
				echo "</td>";

				echo "</tr>";
				$i++;	
			}


			?>

		</table>
		<?php if( strcmp('',$next_token) !== 0 ):?>
		<form method="POST">
			<input type="hidden" name="next_token" value="<?php echo $next_token;?>" />
			<button class="re_next">Next</button>
		</form>
		<?php endif; ?>
	</div>
</div>
